<template>
	<view>
		<view class="box">
			<u-text :text="`当前完成进度 ${finishTestsCount}/${tests.length}`" lineHeight="50px" size="20px" color="#fff"
				align="left"></u-text>
		</view>
		<view>
			<u-list>
				<u-list-item v-for="test in tests">
					<u-cell :title="test.testName" :label="`共 ${test.testTotal} 问`">
						<template #right-icon>
							<u-button text="开始测试" type="primary" size="small"
								@click="but( test.url) ">
							</u-button>
						</template>
					</u-cell>
				</u-list-item>
			</u-list>
		</view>
	</view>
</template>

<script>
	import {
		getPsychologyTestList
	} from '../../../api/psychologyTest/testList';


	export default {
		data() {
			return {
				tests: [],
				finishList: [],
				testStatuList: [],
				finishTestsCount: 0, // 完成了几个测试
				count: 0
			};
		},

		onShow() {
			this.TestList()

		},

		methods: {
			but( url) {
				uni.navigateTo({
					url: url 
				});
			},
			TestList() {
				getPsychologyTestList().then((res) => {
					this.tests = res.rows
					
				})
			}

		}
	};
</script>

<style scoped>
	* {
		margin: 0;
		padding: 0;
	}

	.box {
		height: 50px;
		width: 100%;
		background-color: #02a7f0;
		display: flex;
		align-items: center;
		padding-left: 15px;
	}

	.text-area {
		width: 100%;
		height: 100%;
	}

	/deep/ .u-cell__title-text.data-v-913eaa32 {
		font-size: 35rpx !important;
	}
</style>